package calbs.socket.enu;

/**
 * Created by zhangqin on 2017/8/7.
 */
public enum FrameRespEnum {
    SD_ACCEPT("40","登录通过"),
    SD_REFUSE("41","登录拒绝"),
    SD_FINISH("82","完成标志发送 服务器=>终端"),
    SD_GETLINE("83","AB线信息"),
    SD_UPLOADLINE("84","AB线上传成功"),
    SD_UPDATE("3A","返回升级信息"),
    CMD_NOP("00","空针")
    ;
    private String frameNumber;
    private String description;
    public String getFrameNumber() {
        return frameNumber;
    }

    public void setFrameNumber(String frameNumber) {
        this.frameNumber = frameNumber;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    FrameRespEnum(String frameNumber, String description) {
        this.frameNumber = frameNumber;
        this.description = description;
    }

    public static FrameRespEnum getFrameEnum(String frameNumber){
        for (FrameRespEnum frameReqEnum : FrameRespEnum.values()) {
            if(frameReqEnum.getFrameNumber().equals(frameNumber)){
                return frameReqEnum;
            }else{
                continue;
            }
        }
        return CMD_NOP;
    }
}
